package com.hmall.mapper;

import com.hmall.model.MallHistory;
import com.hmall.util.MyMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;
@Repository
public interface MallHistoryMapper extends MyMapper<MallHistory> {
    List<Integer> selectByUserIdByCreateTime(@Param(value = "userId") int userId, @Param(value = "maxCount") int maxCount);

    //足迹
    List<Integer> selectView(@Param("userId") Integer userId, @Param("pageStart") int pageStart, @Param("pageSize") int pageSize);

    void myInsert(@Param("mallHistory") MallHistory mallHistory);

    //足迹数目
    int selectViewCount(@Param("userId") Integer userId);

    MallHistory selectByUserIdAndProductId(@Param("userId") Integer userId, @Param("productId") Integer productId);

    //更新历史浏览的时间
    void myUpdate(@Param("mallHistory") MallHistory mallHistory);

    //删除足迹
    void deleteHistory(@Param("historyId") Integer historyId);
}